package com.pclong.fightlandlordserver.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @date 2011-10-12, 10:21:18
 * @author long@7road.com
 * @description PropertiesHelper：读取properties配置文件的工具类
 * 
 */
public class PropertiesHelper {

    public static String getProperty(String fileName, String key) {
        String value = "";
        InputStream in = null;
        try {
            in = PropertiesHelper.class.getResourceAsStream("/" + fileName);
            Properties properties = new Properties();
            properties.load(in);
            value = properties.getProperty(key);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return value;
    }
}
